package com.shaobufan.museum.controllar;

import com.shaobufan.museum.common.BaseResponse;
import com.shaobufan.museum.common.ResultUtils;
import com.shaobufan.museum.pojo.vo.ScheduleVo;
import com.shaobufan.museum.service.ScheduleService;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

import static com.shaobufan.museum.contant.ScheduleContent.SCHEDULE_GET_SUCCESS;
/**
 * 日程请求
 */
@RestController
@RequestMapping("/schedule")
public class ScheduleController {
    @Resource
    ScheduleService scheduleService;

    @ApiOperation("查询全部日程")
    @PostMapping("/all")
    public BaseResponse<List<ScheduleVo>> allUserSchedule() {
        List<ScheduleVo> scheduleVoList = scheduleService.searchAllSchedule();
        return ResultUtils.success(scheduleVoList, SCHEDULE_GET_SUCCESS);
    }
}